// VBConversions Note: VB project level imports
using System.Collections.Generic;
using System;
using System.Linq;
using System.Drawing;
using System.Diagnostics;
using Microsoft.VisualBasic;
using System.Xml.Linq;
using Microsoft.VisualBasic.Compatibility;
using System.Windows.Forms;
using System.Collections;
using System.Data;
// End of VB project level imports


namespace 喷码数据生成工具
{
	public class CheckCode
	{
		/// <summary>
		/// 百世物流
		/// </summary>
		/// <param name="mCode"></param>
		/// <returns></returns>
		/// <remarks></remarks>
		public string BaiShiTong3(string mCode)
		{
			string returnValue = "";
			int i = 0;
			int la = 0;
			int SumV = 0;
			int Re = 0;
			string tmp = "";
			la = mCode.Length;
			for (i = 1; i <= la; i++)
			{
				tmp = mCode.Substring(i - 1, 1);
				if (i % 2 != 0)
				{
					SumV = (int) (SumV + Conversion.Val(tmp) * 3);
				}
				else
				{
					SumV = (int) (SumV + Conversion.Val(tmp) * 1);
				}
			}
			Re = SumV % 10;
			if (10 - Re >= 10)
			{
				returnValue = "0";
			}
			else
			{
				returnValue = Conversion.Str(10 - Re).Trim();
			}
			return returnValue;
		}
		/// <summary>
		/// 信丰2位
		/// </summary>
		/// <param name="mCode"></param>
		/// <returns></returns>
		/// <remarks></remarks>
		public string XinFeng1245(string mCode) //??1
		{
			string returnValue = "";
			string STR2 = "";
			string STR1 = "";
			string R = "";
			STR1 = mCode.Substring(mCode.Length - 1, 1);
			STR2 = mCode.Substring(mCode.Length - 2, 2);
			STR2 = STR2.Substring(0, 1);
			if (STR1 == "0")
			{
				R = "9";
			}
			else
			{
				R = Conversion.Str(System.Math.Abs(Conversion.Val(STR1) - 1));
			}
			returnValue = R.Trim();
			return returnValue;
		}
		/// <summary>
		/// 信丰3位
		/// </summary>
		/// <param name="mCode"></param>
		/// <returns></returns>
		/// <remarks></remarks>
		public string XinFeng3(string mCode) //??3
		{
			string returnValue = "";
			string x1 = "";
			string STR2 = "";
			string STR1 = "";
			string R = "";
			string x2 = "";
			STR1 = mCode.Substring(mCode.Length - 1, 1);
			STR2 = mCode.Substring(mCode.Length - 2, 2);
			STR2 = STR2.Substring(0, 1);
			if (STR1 == "0")
			{
				R = "9";
			}
			else
			{
				R = Conversion.Str(System.Math.Abs(Conversion.Val(STR1) - 1));
			}
			x1 = Conversion.Str(Conversion.Val(STR1) * 6 + 3).Substring(Conversion.Str(Conversion.Val(STR1) * 6 + 3).Length - 1, 1);
			x2 = Conversion.Str(Conversion.Val(STR2) * 8 + 5).Substring(Conversion.Str(Conversion.Val(STR2) * 8 + 5).Length - 1, 1);
			returnValue = R + x1 + x2.Trim();
			return returnValue;
		}
		/// <summary>
		/// 顺丰
		/// </summary>
		/// <param name="mCode"></param>
		/// <returns></returns>
		/// <remarks></remarks>
		public string SunFeng(string mCode)
		{
			int i = 0;
			int la = 0;
			int SANG = 0;
			int XJ = 0;
			string Tmt = "";
			int n = 0;
			int YS = 0;
			int SumJ = 0;
			int m = 0;
			la = mCode.Length;
			if (la != 11)
			{
				throw (new Exception("顺丰流水号长度必须为11位，验证号码长度为：" + System.Convert.ToString(mCode.Length) + "位，不能使用此校验方式！"));
				return "";
			}
			n = -1;
			for (i = 4; i <= la; i++)
			{
				Tmt = mCode.Substring(i - 1, 1);
				n++;
				XJ = (int) ((19 - i - n) * Conversion.Val(Tmt));
				YS = XJ % 10;
				SANG = XJ / 10;
				SumJ = SumJ + YS + SANG;
			}
			m = (int) (10 - Conversion.Val(Conversion.Str(SumJ).Substring(Conversion.Str(SumJ).Length - 1, 1)));
			return m % 10;
		}
		/// <summary>
		/// Only_Vector
		/// </summary>
		/// <param name="mCode"></param>
		/// <returns></returns>
		/// <remarks></remarks>
		public string Only_Vector(string mCode)
		{
			string returnValue = "";
			int StrLen = 0;
			int TmpR = 0;
			int[] CanShu = null;
			StrLen = mCode.Length;
			if (StrLen != 8)
			{
				throw (new Exception("号码长度错误，长度必须为8位，请检查设置!"));
			}
			CanShu = new int[] {8, 4, 5, 7, 9, 2, 1};
			for (var i = 0; i <= StrLen - 1; i++)
			{
				TmpR = (int) (TmpR + Conversion.Val(mCode.Substring(System.Convert.ToInt32(i), 1)) * CanShu[(int) i]);
			}
			returnValue = Conversion.Str(TmpR).Substring(Conversion.Str(TmpR).Length - 1, 1);
			return returnValue;
		}
		/// <summary>
		/// 港中能达
		/// </summary>
		/// <param name="mCode"></param>
		/// <returns></returns>
		/// <remarks></remarks>
		public string GangZhong(string mCode)
		{
			float StrLen = 0;
			string Tmp1 = "";
			string Tmp2 = "";
			StrLen = mCode.Length;
			if (StrLen != 10)
			{
				throw (new Exception("流水号长度必须等于10位!"));
			}
			Tmp1 = mCode.Substring(5, 1);
			Tmp2 = mCode.Substring(9, 1);
			return ((Conversion.Val(Tmp1) + Conversion.Val(Tmp2)) % 10);
		}
		/// <summary>
		/// 模11
		/// </summary>
		/// <param name="a"></param>
		/// <returns></returns>
		/// <remarks></remarks>
		public string ModEleven(string a)
		{
			int C = 0;
			int sum = 0;
			if (a.Length != 8)
			{
				throw (new Exception("号码长度必须为8位！"));
			}
			sum = (int.Parse(a.Substring(0, 1))) * 8; // CInt(Left(a, 1)) * 8
			sum = sum + (int.Parse(a.Substring(1, 1))) * 6;
			sum = sum + (int.Parse(a.Substring(2, 1))) * 4;
			sum = sum + (int.Parse(a.Substring(3, 1))) * 2;
			sum = sum + (int.Parse(a.Substring(4, 1))) * 3;
			sum = sum + (int.Parse(a.Substring(5, 1))) * 5;
			sum = sum + (int.Parse(a.Substring(6, 1))) * 9;
			sum = sum + (int.Parse(a.Substring(7, 1))) * 7;
			C = sum % 11;
			if (C == 0)
			{
				return System.Convert.ToString( 5);
			}
			if (C == 1)
			{
				return System.Convert.ToString( 0);
			}
			return System.Convert.ToString( 11 - C);
		}
		/// <summary>
		/// 全一
		/// </summary>
		/// <param name="mCode"></param>
		/// <returns></returns>
		/// <remarks></remarks>
		public string QuanYI(string mCode)
		{
			string returnValue = "";
			object bar4 = null;
			float CL = 0;
			string STR2;
			string STR1;
			string Str3;
			string Bar2 = "";
			string Bar1 = "";
			string Bar3 = "";
			int Chk1 = 0;
			int Chk2 = 0;
			int No2 = 0;
			int Chk3 = 0;
			int No1 = 0;
			CL = mCode.Length;
			if (CL != 11)
			{
				throw (new Exception("流水号长度必须为11为，请检查输入的号码！"));
				return "";
			}
			STR1 = mCode.Substring(0, 4);
			STR2 = mCode.Substring(4, 4);
			Str3 = mCode.Substring(8, 3);
			Bar1 = mCode.Substring(0, 9);
			Bar2 = mCode.Substring(9, 1);
			Bar3 = mCode.Substring(10, 1);
			Chk1 = System.Convert.ToInt32(Conversion.Val(Bar1) % 7);
			No1 = int.Parse(Conversion.Str(Chk1) + Bar2);
			Chk2 = System.Convert.ToInt32(Conversion.Val((No1).ToString()) % 7);
			No2 = int.Parse(Conversion.Str(Chk2) + Bar3);
			Chk3 = System.Convert.ToInt32(Conversion.Val((No2).ToString()) % 7);
			bar4 = Conversion.Str(Chk3);
			returnValue = Strings.Trim(System.Convert.ToString(bar4));
			return returnValue;
		}
		/// <summary>
		/// 模7
		/// </summary>
		/// <param name="mCode"></param>
		/// <returns></returns>
		/// <remarks></remarks>
		public string Mod7(string mCode)
		{
			int i = 0;
			int ca = 0;
			int TmpValue = 0;
			if (mCode.Length > 9)
			{
				ca = System.Convert.ToInt32(mCode.Length / 8);
				for (i = 0; i <= ca; i++)
				{
					TmpValue = System.Convert.ToInt32(Conversion.Val(TmpValue + mCode.Substring(i * 8 + 1 - 1, 8)) % 7);
				}
				return (TmpValue).ToString();
			}
			else
			{
				return ((int.Parse(mCode)) % 7).ToString();
			}
		}
		/// <summary>
		/// WaybillNoList
		/// </summary>
		/// <param name="Value"></param>
		/// <returns></returns>
		/// <remarks></remarks>
		public string getWaybillNoList(string Value)
		{
			int i = 0; //WaybillNoList
			Value = Value.Trim();
			if (Value.Length != 11)
			{
				throw (new Exception("号码长度必须为11位！"));
			}
			return "";
//			int TmpValue1 = 0;
//			int TmpValue2 = 0;
//			int TmpValue3 = 0;
//			long Qsum = 0;
//			int m = 0;
//			for (i = 4; i <= 11; i++)
//			{
//				TmpValue1 = (int) (Conversion.Val(Value.Substring(i - 1, 1)));
//				TmpValue3 = System.Math.Abs(~(TmpValue1)) * TmpValue1;
//				TmpValue2 = TmpValue3 / 10 + (TmpValue3 - 10 * (TmpValue3 / 10));
//				Qsum = System.Convert.ToInt64(Qsum + TmpValue2);
//				}
//				m = System.Convert.ToInt32((Qsum / 10 + 1) * 10);
//				return (System.Convert.ToInt32(m - Qsum) % 10).ToString();
			}
			/// <summary>
			/// 港中能达无限制
			/// </summary>
			/// <param name="Value"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string getGangzhongNengDa(string Value) //??????
			{
				string returnValue = "";
				string a = "";
				string b = "";
				short sum = 0;
				string Result = "";
				Value = Value.Trim();
				a = Value.Substring(Value.Length - 4 - 1, 1);
				b = Value.Substring(Value.Length - 1, 1);
				sum = (short) (Conversion.Val(a) + Conversion.Val(b));
				Result = (sum).ToString().Substring((sum).ToString().Length - 1, 1);
				returnValue = Result;
				return returnValue;
			}
			/// <summary>
			/// 中铁
			/// </summary>
			/// <param name="value"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string getCheckZhongtian(string value)
			{
				int SUM1 = 0;
				int Sum2 = 0;
				int sum = 0;
				int tmpSum = 0;
				int sIndex = 0;
				for (var i = value.Length - 1; i >= 0; i--)
				{
					sIndex++;
					if (sIndex > 1 & sIndex % 2 == 0)
					{
						SUM1 += int.Parse(value.Substring(System.Convert.ToInt32(i), 1));
					}
					else if (sIndex > 2 & sIndex % 2 != 0)
					{
						Sum2 += int.Parse(value.Substring(i, 1));
					}
				}
				SUM1 = SUM1 * 3 + 18;
				Sum2 = Sum2 * 2 - 3;
				sum = (SUM1 + Sum2) * 7;
				tmpSum = sum;
				while (!(tmpSum >= sum & tmpSum % 13 == 0))
				{
					tmpSum++;
				}
				return Strings.Right((tmpSum - sum).ToString(), 1);
			}
			/// <summary>
			/// 晋越
			/// </summary>
			/// <param name="a"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string GetJinYue(string a)
			{
				string returnValue = "";
				int i = 0;
				int Sum = 0;
				int Result = 0;
				object tmp = null;
				if (a.Length != 11)
				{
					throw (new Exception("流水号长度必须为11位！"));
				}
				for (i = 1; i <= 10; i++)
				{
					tmp = a.Substring(i - 1, 1);
					Sum = Sum + Convert.ToInt32(tmp);
				}
				Sum = Sum - Convert.ToInt32(a.Substring(10, 1));
				Result = Sum % 9;
				returnValue = System.Convert.ToString(Result);
				return returnValue;
			}
			/// <summary>
			/// 黄马甲
			/// </summary>
			/// <param name="a"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string Gethuangmajia(string a) //??
			{
				if (a.Length != 10)
				{
					throw (new Exception("流水号长度必须为10位！"));
				}
				string str9 = "";
				string str7 = "";
				string str5 = "";
				string str3 = "";
				string str1 = "";
				string str2 = "";
				string str4 = "";
				string str6 = "";
				string str8 = "";
				string str10 = "";
				int sum2 = 0;
				int sum1 = 0;
				string result = "";
				str1 = a.Substring(0, 1);
				str2 = a.Substring(1, 1);
				str3 = a.Substring(2, 1);
				str4 = a.Substring(3, 1);
				str5 = a.Substring(4, 1);
				str6 = a.Substring(5, 1);
				str7 = a.Substring(6, 1);
				str8 = a.Substring(7, 1);
				str9 = a.Substring(8, 1);
				str10 = a.Substring(9, 1);
				sum1 = (int.Parse(str1)) + (int.Parse(str2)) + (int.Parse(str3)) + (int.Parse(str4)) + int.Parse(str5);
				sum2 = (int.Parse(str6)) + (int.Parse(str7)) + (int.Parse(str8)) + (int.Parse(str9)) + int.Parse(str10);
				sum1 = sum1 % 7;
				sum2 = sum2 % 7;
				result = sum1 + System.Convert.ToString(sum2);
				return result;
			}
			/// <summary>
			/// 深圳石化
			/// </summary>
			/// <param name="Value"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string getSHCheck(string Value)
			{
				int sum = 0;
				int count = 0;
				string tmp = "";
				string Result = "";
				for (int i = 0; i <= Value.Length - 1; i++)
				{
					tmp = Value.Substring(i, 1);
					sum = sum + Strings.Asc(Convert.ToChar(tmp));
				}
				count = sum % 43;
				Result = string.Format("{0:D2}", count);
				return Result;
			}
			/// <summary>
			/// 城市应急
			/// </summary>
			/// <param name="Value"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string CityExpress(string Value)
			{
				const string tmpValue = "243674494654";
				if (Value.Length != 12)
				{
					throw (new Exception("号码长度必须为12位！"));
				}
				int sum = 0;
				for (var i = 0; i <= Value.Length - 1; i++)
				{
					sum += (int) (Conversion.Val(Value.Substring(System.Convert.ToInt32(i), 1)) * Conversion.Val(tmpValue.Substring(System.Convert.ToInt32(i), 1)));
				}
				return sum.ToString().Substring(sum.ToString().Length - 1, 1);
			}
			/// <summary>
			/// 三凌空调
			/// </summary>
			/// <param name="Value"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string getSanlinkongtiao(string Value)
			{
				int sum = 0;
				for (var i = 0; i <= Value.Length - 1; i++)
				{
					sum += Strings.AscW(Value.Substring(i, 1));
				}
				return (sum % 10).ToString();
			}
			/// <summary>
			/// 三凌重工
			/// </summary>
			/// <param name="value"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string getSanLinZhongGong(string value)
			{
				int sum = 0;
				int LastValue = 0;
				for (var i = 0; i <= value.Length - 1; i++)
				{
					sum += (int) (Conversion.Val(value.Substring(System.Convert.ToInt32(i), 1)));
				}
				LastValue = (int) (Conversion.Val(sum.ToString().Substring(sum.ToString().Length - 1, 1)) + 2);
				return LastValue.ToString().Substring(LastValue.ToString().Length - 1, 1);
			}
			/// <summary>
			/// 模10
			/// </summary>
			/// <param name="a"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string getMod10(string a)
			{
				int Sum1 = 0;
				int Sum2 = 0;
				int Result = 0;
				int La = 0;
				La = a.Length;
				for (var i = 1; i <= La; i++)
				{
					if (i % 2 == 0)
					{
						Sum2 = Sum2 + int.Parse(a.Substring(i - 1, 1));
					}
					else
					{
						Sum1 = Sum1 + int.Parse(a.Substring(i - 1, 1));
					}
				}
				Result = System.Convert.ToInt32((Sum1 * 3 + Sum2) % 10);
				if (Result == 0)
				{
					return System.Convert.ToString( 0);
				}
				else
				{
					return System.Convert.ToString( 10 - Result);
				}
			}
			/// <summary>
			/// 安能运单校验规则
			/// </summary>
			/// <param name="StrFullOldBarcode"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string GetAnNeng(string StrFullOldBarcode)
			{
				int sum = 0;
				if (StrFullOldBarcode.Length != 11)
				{
					throw (new Exception("号码长度错误"));
				}
				int[] tmp = new int[] {7, 4, 2, 5, 3, 6, 8, 2, 9};
				string S = StrFullOldBarcode.Substring(2, 9);
				for (int i = 0; i <= S.Length - 1; i++)
				{
					sum = sum + (int.Parse(S.Substring(i, 1))) * tmp[i];
				}
				// Dim Sum1 As Integer = 11 - (sum Mod 11)
				int ModValue = sum % 11;
				if (ModValue == 0)
				{
					return "5";
				}
				else if (ModValue == 1)
				{
					return "0";
				}
				else if (ModValue == 10)
				{
					return "1";
				}
				else
				{
					return (11 - ModValue).ToString();
				}
			}
			/// <summary>
			/// 九福州
			/// </summary>
			/// <param name="Code"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string getAlemtat(string Code)
			{
				if (Code.Length != 7)
				{
					throw (new Exception("号码长度错误，流水号长度必须为7位！" + Code));
				}
				int[] CalValue = new int[] {8, 4, 5, 7, 9, 2, 1};
				int Sum = 0;
				for (var i = 0; i <= Code.Length - 1; i++)
				{
					Sum += Convert.ToInt32(Code.Substring(System.Convert.ToInt32(i), 1)) * CalValue[(int) i];
				}
				return Sum.ToString().Substring(Sum.ToString().Length - 1, 1);
			}
			/// <summary>
			/// 深圳交通管理处罚书
			/// </summary>
			/// <param name="code"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string GetGongAnpenalty(string code)
			{
				if (code.Length != 9)
				{
					throw (new Exception("流水号长度错误，只能计算9位流水号！"));
				}
				else
				{
					string LeftString = code.Substring(1);
					int sum = 0;
					for (int i = 0; i <= LeftString.Length - 1; i++)
					{
						sum += Convert.ToInt32(LeftString.Substring(i, 1));
					}
					return (sum % 8).ToString();
				}
			}
			/// <summary>
			/// 亚风物流7位
			/// </summary>
			/// <param name="Code"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string GetYaFeng7(string Code)
			{
				if (Code.Length != 6)
				{
					throw (new Exception("号码长度错误，必须为6位流水号！"));
				}
				else
				{
					int result = 0;
					const string param = "795324";
					for (var i = 0; i <= Code.Length - 1; i++)
					{
						int tmpValue1 = (int) (Conversion.Val(Code.Substring(System.Convert.ToInt32(i), 1)));
						int tmpValue2 = (int) (Conversion.Val(param.Substring(System.Convert.ToInt32(i), 1)));
						result += tmpValue1 * tmpValue2;
					}
					result = result % 11;
					if (result == 0)
					{
						return System.Convert.ToString( 5);
					}
					else if (result == 1)
					{
						return System.Convert.ToString( 0);
					}
					else if (result == 10)
					{
						return System.Convert.ToString( 1);
					}
					else
					{
						return System.Convert.ToString( 11 - result);
					}
				}
			}
			/// <summary>
			/// 亚风物流11为
			/// </summary>
			/// <param name="Code"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string GetYaFeng11(string Code)
			{
				if (Code.Length != 10)
				{
					throw (new Exception("号码长度错误，必须为10位流水号！"));
				}
				else
				{
					int result = 0;
					const string param = "7953246891";
					for (var i = 0; i <= Code.Length - 1; i++)
					{
						int tmp1 = (int) (Conversion.Val(Code.Substring(i, 1)));
						int tmp2 = (int) (Conversion.Val(param.Substring(System.Convert.ToInt32(i), 1)));
						result += tmp1 * tmp2;
					}
					result = result % 11;
					if (result == 0)
					{
						return System.Convert.ToString( 5);
					}
					else if (result == 1)
					{
						return System.Convert.ToString( 0);
					}
					else if (result == 10)
					{
						return System.Convert.ToString( 1);
					}
					else
					{
						return System.Convert.ToString( 11 - result);
					}
				}
			}
			/// <summary>
			/// 亚风物流12位
			/// </summary>
			/// <param name="Code"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string GetYaFeng12(string Code)
			{
				if (Code.Length != 11)
				{
					throw (new Exception("号码长度错误，必须为11为流水号！"));
				}
				else
				{
					int result = 0;
					const string param = "79532468913";
					for (var i = 0; i <= Code.Length - 1; i++)
					{
						int tmp1 = (int) (Conversion.Val(Code.Substring(System.Convert.ToInt32(i), 1)));
						int tmp2 = (int) (Conversion.Val(param.Substring(System.Convert.ToInt32(i), 1)));
						result += tmp1 * tmp2;
					}
					result = result % 11;
					if (result == 0)
					{
						return System.Convert.ToString( 5);
					}
					else if (result == 1)
					{
						return System.Convert.ToString( 0);
					}
					else if (result == 10)
					{
						return System.Convert.ToString( 1);
					}
					else
					{
						return System.Convert.ToString( 11 - result);
					}
				}
			}
			/// <summary>
			/// 亚风物流10位
			/// </summary>
			/// <param name="Code"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string GetYaFeng10(string Code)
			{
				if (Code.Length != 9)
				{
					throw (new Exception("号码长度错误，必须为10位流水号！"));
				}
				else
				{
					int result = 0;
					const string param = "795324689";
					for (var i = 0; i <= Code.Length - 1; i++)
					{
						int tmp1 = (int) (Conversion.Val(Code.Substring(System.Convert.ToInt32(i), 1)));
						int tmp2 = (int) (Conversion.Val(param.Substring(System.Convert.ToInt32(i), 1)));
						result += tmp1 * tmp2;
					}
					result = result % 11;
					if (result == 0)
					{
						return System.Convert.ToString( 5);
					}
					else if (result == 1)
					{
						return System.Convert.ToString( 0);
					}
					else if (result == 10)
					{
						return System.Convert.ToString( 1);
					}
					else
					{
						return System.Convert.ToString( 11 - result);
					}
				}
			}
			/// <summary>
			/// 沙特联邦
			/// </summary>
			/// <param name="code"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string GetShatelianbang(string code)
			{
				if (code.Length != 11)
				{
					throw (new Exception("号码长度错误，必须是11位的流水号"));
				}
				const string param = "51751751751";
				int sum = 0;
				int tmpValue = 0;
				for (var i = 0; i <= code.Length - 1; i++)
				{
					sum += Convert.ToInt32(code.Substring(System.Convert.ToInt32(i), 1)) * Convert.ToInt32(param.Substring(System.Convert.ToInt32(i), 1));
				}
				tmpValue = sum % 11;
				if (tmpValue == 10)
				{
					return "0";
				}
				return System.Convert.ToString( tmpValue);
			}
			/// <summary>
			/// 优速Y单
			/// </summary>
			/// <param name="code"></param>
			/// <returns></returns>
			/// <remarks></remarks>
			public string GetYouShuY(string code)
			{
				if (code.Length != 12)
				{
					throw (new Exception("流水号码长度错误，必须为12位！"));
				}
				string str1 = "";
				string str2 = "";
				float sValue = 0;
				float sValue1 = 0;
				str1 = code.Substring(8, 4);
				str2 = code.Substring(10, 1);
				sValue = System.Convert.ToSingle(Convert.ToInt32(str1) % 7 + 3);
				sValue1 = Convert.ToInt32(str2) * 7 + 3;
				str2 = sValue1.ToString();
				return sValue + str2.Substring(str2.Length - 1, 1);
			}
		}
		
	}
